from mm.Hungarian import Hungarian
from mm.KM import KM
from mst.BC import BC
from mst.Kruskal import Kruskal
from mst.Prim import Prim
from sp.Dijkstra import Dijkstra
from sp.Floyd import Floyd
from sp.FW import FW

while True:
    print('--------------------')
    print('图论算法：')
    print('1.最小生成树')
    print('2.最短路径')
    print('3.最大匹配')
    print('--------------------')
    i = input()
    print('--------------------')

    if i == '1':
        print('最小生成树：')
        print('0.返回')
        print('1.Kruskal')
        print('2.Prim')
        print('3.破圈法')
        print('--------------------')
        j = input()
        print('--------------------')
        if j == '1':
            Kruskal.do_mst()
        elif j == '2':
            Prim.do_prim()
        elif j == '3':
            BC.do_bc()
    elif i == '2':
        print('最短路径：')
        print('0.返回')
        print('1.Dijkstra')
        print('2.Floyd')
        print('3.Floyd-Warshall')
        print('--------------------')
        j = input()
        print('--------------------')
        if j == '1':
            Dijkstra.do_dijkstra()
        elif j == '2':
            Floyd.do_floyd()
        elif j == '3':
            FW.do_floyd_warshall()
    elif i == '3':
        print('最大匹配：')
        print('0.返回')
        print('1.Hungarian')
        print('2.Kuhn-Munkres')
        print('--------------------')
        j = input()
        print('--------------------')
        if j == '1':
            Hungarian.do_hungary()
        elif j == '2':
            KM.do_km()
